# 指定基础镜像，格式为：FROM image:tag
FROM mongo:latest
MAINTAINER wangfuqiang "wafu7969@qq.com"

# 设置时区

ENV TZ=Asia/Shanghai

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# setup.sh为需要初始化的数据 我们需要把他拷贝到容器的/docker-entrypoint-initdb.d目录

ENV AUTO_RUN_DIR /docker-entrypoint-initdb.d

ENV INSTALL_MONGO_SHELL setup.sh

COPY ./mongodb/$INSTALL_MONGO_SHELL $AUTO_RUN_DIR/

RUN chmod a+x $AUTO_RUN_DIR/$INSTALL_MONGO_SHELL
